<script>
$(document).ready(function() {
	var button = $("#uploadButton"), interval;
	$.ajax_upload(button, {
				action : base_url + "admin/files/upload_file/"+instanceName+"/"+instanceId,
				name : 'file',
				
				onSubmit : function(file, ext) 
				{
					$("#uploadButton").text('Загрузка');
					$("#uploadButton").html("<img src='/img/load.gif' />");
					this.disable();
				},
				
				onComplete : function(file, response) 
				{
					$("#uploadButton").text("Загрузить");
					this.enable();
					if (response.length > 1)
						jAlert(response);
						else
						jAlert(tr('loadingerror'));
					loadPhotoAlbum("0", "photoDiv");
					refreshAva();
					setTimeout(function(){$("#popup_container").fadeOut();
					$("#popup_overlay").remove()}, 5000);
				},
				
				onError: function(file, response)
				{
					if (!response)
					{
						$("#uploadButton").text(tr('add'));
						this.enable();
						loadPhotoAlbum("0", "photoDiv");
					}
				}
			});
});
</script>

Загрузка нового файла<br/>
<form action="/admin/files/upload_file" enctype="multipart/form-data" method="post">
	<input name="file" type="file" /> <br/>
	<input type="submit" value="OK"/>
</form>